<link href="../plugins/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="../plugins/bootstrap-fontAwesome/css/font-awesome.css">
<div ng-controller="settleCtrl">
    <div id="main" class="container">
        <div class="panel panel-default">
            <div class="panel-heading">
                <form class="form-inline">
                    <div class="form-group">
                        <label>
                            <select class="form-control"
                                    ng-model="settleGroup.currentSettleStatus"
                                    ng-options="s.value for s in settleGroup.settleStatusList" ng-change="changeSettleStatus()"></select>
                        </label>
                        <label>
                            <input type="text" ng-model="startTime" class="form-control form_date" style="width: 100px;">
                        </label>
                        <label class="glyphicon glyphicon-minus"></label>
                        <label>
                            <input type="text"  ng-model="endTime" class="form-control form_date" style="width: 100px;">
                        </label>
                    </div>
                    <div class="form-group" style="margin-left: 10px;">
                        <label class="control-label">关键字：</label>
                        <label>
                            <input type="text"  style="width: 400px;" ng-model="searchKey" class="form-control" placeholder="请输入场馆Id/场馆Code/场馆名">
                        </label>
                        <button class="btn btn-primary icon-search" title="点击查询" ng-click="loadResult()">&nbsp;确定</button>
                    </div>
                    <button class="btn btn-default icon-cloud-download pull-right" title="导出" ng-click="exportResult()">&nbsp;导出</button>

                    <!-- Single button -->
                    <div class="btn-group" style="float: right;">
                        <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                            批量操作<span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu dropdown-menu-left" ng-class="{false:'disabled'}[batchEnable]">
                            <li ng-class="{true:'disabled'}[settleGroup.canOp($index)]" ng-repeat="op in settleGroup.operationAndEvent"><a href="#" ng-click="op.event()">{{op.opName}}</a></li>
                        </ul>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="container">
        <div class="progress" ng-show="loadingBar.inProcess">
            <div class="progress-bar" role="progressbar" aria-valuenow="{{loadingBar.currentCount/loadingBar.totalCount*100|number:2}}" aria-valuemin="0" aria-valuemax="100" style="width:{{loadingBar.currentCount/loadingBar.totalCount*100|number:2}}%;">
                {{loadingBar.currentCount/loadingBar.totalCount*100|number:2}}%
            </div>
        </div>
    </div>
    <div class="container">
        <div class="panel panel-default">
            <!-- Default panel contents -->
            <div class="panel-heading">
                结算信息
            </div>
            <!-- Table -->
            <table class="table table-hover .table-condensed ">
                <tr >
                    <th>
                        <div ng-click="checkAll()" style="width: 18px;">
                            <span ng-class="{true:'icon-check',false:'icon-check-empty'}[checkAllStatus]" style="cursor: pointer;font-size: 18px;"></span>
                        </div>
                    </th>
                    <th class="text-center">ID</th>
                    <th class="text-center">编号</th>
                    <th class="text-center">场馆</th>
                    <th class="text-center">结算额</th>
                    <th>预定</th>
                    <th>支付金额</th>
                    <th>补贴额</th>
                    <th>总计</th>
                </tr>
                <tr ng-repeat="s in settleList" ng-click="doCheck($index)">
                    <td>
                        <div style="margin-top: 20px;width: 18px;">
                            <span ng-class="{true:'icon-check',false:'icon-check-empty'}[s.checked]" style="cursor: pointer;font-size: 18px;"></span>
                        </div>
                    </td>
                    <td class="text-center">
                        <h4 style="margin-top: 20px;">{{s.shopId}}</h4>
                    </td>
                    <td class="text-center">
                        <h4 style="margin-top: 20px;">{{s.shopCode}}</h4>
                    </td>
                    <td class="text-center">
                        <h4 style="margin-top: 20px;">{{s.shopName|limitTo:8}}<abbr title="{{s.shopName}}" ng-if="s.shopName.length>8" class="icon-question-sign"></abbr></h4>
                    </td>
                    <td class="text-center">
                        <h4 style="color: #67b168;margin-top: 20px;">{{s.realSettleSum|currency:'￥'}}</h4>
                    </td>
                    <td>
                        订单数：{{s.orderNum}}<br>
                        场次数：{{s.settleNum}}/{{s.goodsTotalNum}}<br>
                        预订率：{{s.settleNum/s.goodsTotalNum*100|number:2}}%
                    </td>
                    <td>
                        总：{{s.paySum|currency:'￥'}}<br>
                        卡：{{s.memberPaySum|currency:'￥'}}<br>
                        支：{{s.aliPaySum|currency:'￥'}}<br>
                        微：{{s.wxPaySum|currency:'￥'}}
                    </td>
                    <td>
                        总：{{s.totalSubsidySum|currency:'￥'}}<br>
                        卡：{{s.memberSubsidySum|currency:'￥'}}<br>
                        支：{{s.aliPaySubsidySum|currency:'￥'}}<br>
                        微：{{s.wxSubsidySum|currency:'￥'}}<br>
                        免：{{s.freeSubsidySum|currency:'￥'}}
                    </td>
                    <td>
                        总金额：{{s.totalSum|currency:'￥'}}<br>
                        手续费：{{s.totalFee|currency:'￥'}}<br>
                        应结额：{{s.realSettleSum|currency:'￥'}}
                        <!--<br>卡结：{{s.memberSettleSum|currency:'￥'}}
                        <br>宝结：{{s.aliPaySettleSum|currency:'￥'}}
                        <br>微：{{s.wxSettleSum|currency:'￥'}}
                        <br>免：{{s.freeSettleSum|currency:'￥'}}-->
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div>
        <form id="exportForm" action="export/excel/settleDoc" method="post">
            <input type="hidden" name="startTime" value="{{startTime}}">
            <input type="hidden" name="endTime" value="{{endTime}}">
        </form>
    </div>
</div>
<script type="text/javascript">

</script>